package com.zyp.bridge;


/**
 * 计算机:有多个品牌，他们都有不同的软件
 * 合成/聚合 关系
 * @author Administrator
 *
 */
public abstract class IComputer {
	
	protected IHardware hardware;
	
	protected String name;
	
	public IComputer(String name){
		this.name=name;
	}
	
	public IHardware getHardware() {
		return hardware;
	}

	public void setHardware(IHardware hardware) {
		this.hardware = hardware;
	}



	public abstract void start();
	
}


class Dell extends IComputer{

	public Dell(String name) {
		super(name);
	}

	public void start() {
		hardware.run(name);
	}

}

class Lenovo extends IComputer{

	public Lenovo(String name) {
		super(name);
	}

	public void start() {
		hardware.run(name);
	}

}

